# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1Assessment do
  @moduledoc """
  A reCAPTCHA Enterprise assessment resource.

  ## Attributes

  *   `accountDefenderAssessment` (*type:* `GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1AccountDefenderAssessment.t`, *default:* `nil`) - Output only. Assessment returned by account defender when an account identifier is provided.
  *   `accountVerification` (*type:* `GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1AccountVerificationInfo.t`, *default:* `nil`) - Optional. Account verification information for identity verification. The assessment event must include a token and site key to use this feature.
  *   `assessmentEnvironment` (*type:* `GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1AssessmentEnvironment.t`, *default:* `nil`) - Optional. The environment creating the assessment. This describes your environment (the system invoking CreateAssessment), NOT the environment of your user.
  *   `event` (*type:* `GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1Event.t`, *default:* `nil`) - Optional. The event being assessed.
  *   `firewallPolicyAssessment` (*type:* `GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1FirewallPolicyAssessment.t`, *default:* `nil`) - Output only. Assessment returned when firewall policies belonging to the project are evaluated using the field firewall_policy_evaluation.
  *   `fraudPreventionAssessment` (*type:* `GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1FraudPreventionAssessment.t`, *default:* `nil`) - Output only. Assessment returned by Fraud Prevention when TransactionData is provided.
  *   `fraudSignals` (*type:* `GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1FraudSignals.t`, *default:* `nil`) - Output only. Fraud Signals specific to the users involved in a payment transaction.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Identifier. The resource name for the Assessment in the format `projects/{project}/assessments/{assessment}`.
  *   `phoneFraudAssessment` (*type:* `GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1PhoneFraudAssessment.t`, *default:* `nil`) - Output only. Assessment returned when a site key, a token, and a phone number as `user_id` are provided. Account defender and SMS toll fraud protection need to be enabled.
  *   `privatePasswordLeakVerification` (*type:* `GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1PrivatePasswordLeakVerification.t`, *default:* `nil`) - Optional. The private password leak verification field contains the parameters that are used to to check for leaks privately without sharing user credentials.
  *   `riskAnalysis` (*type:* `GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1RiskAnalysis.t`, *default:* `nil`) - Output only. The risk analysis result for the event being assessed.
  *   `tokenProperties` (*type:* `GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1TokenProperties.t`, *default:* `nil`) - Output only. Properties of the provided event token.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :accountDefenderAssessment =>
            GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1AccountDefenderAssessment.t()
            | nil,
          :accountVerification =>
            GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1AccountVerificationInfo.t()
            | nil,
          :assessmentEnvironment =>
            GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1AssessmentEnvironment.t()
            | nil,
          :event =>
            GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1Event.t() | nil,
          :firewallPolicyAssessment =>
            GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1FirewallPolicyAssessment.t()
            | nil,
          :fraudPreventionAssessment =>
            GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1FraudPreventionAssessment.t()
            | nil,
          :fraudSignals =>
            GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1FraudSignals.t()
            | nil,
          :name => String.t() | nil,
          :phoneFraudAssessment =>
            GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1PhoneFraudAssessment.t()
            | nil,
          :privatePasswordLeakVerification =>
            GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1PrivatePasswordLeakVerification.t()
            | nil,
          :riskAnalysis =>
            GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1RiskAnalysis.t()
            | nil,
          :tokenProperties =>
            GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1TokenProperties.t()
            | nil
        }

  field(:accountDefenderAssessment,
    as:
      GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1AccountDefenderAssessment
  )

  field(:accountVerification,
    as:
      GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1AccountVerificationInfo
  )

  field(:assessmentEnvironment,
    as:
      GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1AssessmentEnvironment
  )

  field(:event, as: GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1Event)

  field(:firewallPolicyAssessment,
    as:
      GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1FirewallPolicyAssessment
  )

  field(:fraudPreventionAssessment,
    as:
      GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1FraudPreventionAssessment
  )

  field(:fraudSignals,
    as: GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1FraudSignals
  )

  field(:name)

  field(:phoneFraudAssessment,
    as:
      GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1PhoneFraudAssessment
  )

  field(:privatePasswordLeakVerification,
    as:
      GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1PrivatePasswordLeakVerification
  )

  field(:riskAnalysis,
    as: GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1RiskAnalysis
  )

  field(:tokenProperties,
    as: GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1TokenProperties
  )
end

defimpl Poison.Decoder,
  for: GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1Assessment do
  def decode(value, options) do
    GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1Assessment.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1Assessment do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
